package com.xce.storage.controller;

import com.xce.storage.service.StorageService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Tag(name = "接口")
@RestController
public class StorageController {

    @Autowired
    private StorageService storageService;

    @Operation(summary = "新增")
    @GetMapping("/deduct")
    public String deduct(@RequestParam String commodityCode,
                         @RequestParam Integer count)  {
        storageService.deduct(commodityCode, count);
        return "storage deduct success";
    }
}
